#include <asm.h>
#include <regdef.h>
#include <inst_test.h>

LEAF(n41_bltzal_test)
    .set noreorder
    addiu s0, s0 ,1
    li  s2, 0x0
###test inst
    TEST_BLTZAL(0xc564aaee, 0xf1026890, 0x39dd5800, 0xf1026890, 0x39dd5800)
    TEST_BLTZAL(0x655e408b, 0x6c41162c, 0x8d5cd86f, 0x00000000, 0x00000000)
    TEST_BLTZAL(0xd941dbc8, 0xe6b2af00, 0x4c80b4b6, 0xe6b2af00, 0x4c80b4b6)
    TEST_BLTZAL(0x18c1552a, 0x35163822, 0x34ffade0, 0x00000000, 0x00000000)
    TEST_BLTZAL(0xa80025a1, 0xe079deb3, 0x774bba9e, 0xe079deb3, 0x774bba9e)
    TEST_BLTZAL(0x8ff9842b, 0x978af84a, 0xd770ef60, 0x978af84a, 0xd770ef60)
    TEST_BLTZAL(0x663da924, 0xf95f2930, 0x4654a65c, 0x00000000, 0x00000000)
    TEST_BLTZAL(0xd97064ee, 0xb95ffbe8, 0x619a80f4, 0xb95ffbe8, 0x619a80f4)
    TEST_BLTZAL(0x54474420, 0xf6749e10, 0x0f558b00, 0x00000000, 0x00000000)
    TEST_BLTZAL(0xf3595c58, 0x3610309b, 0xb61e33d0, 0x3610309b, 0xb61e33d0)
    TEST_BLTZAL(0xd8dc4820, 0x557637b4, 0x910e3aa0, 0x557637b4, 0x910e3aa0)
    TEST_BLTZAL(0xaa8a4c98, 0x27e9c330, 0xae081f3e, 0x27e9c330, 0xae081f3e)
    TEST_BLTZAL(0xd9c4ed40, 0x635ed0a2, 0xdec2e92c, 0x635ed0a2, 0xdec2e92c)
    TEST_BLTZAL(0x68397fdc, 0xe165e880, 0x45d1fd2c, 0x00000000, 0x00000000)
    TEST_BLTZAL(0x05172a80, 0x741763bc, 0x3ec46470, 0x00000000, 0x00000000)
    TEST_BLTZAL(0xae593468, 0xf3dacee9, 0x7606d4f0, 0xf3dacee9, 0x7606d4f0)
    TEST_BLTZAL(0x91d6b8c2, 0x0551f160, 0x4f006da0, 0x0551f160, 0x4f006da0)
    TEST_BLTZAL(0xa06b6b90, 0x97ee8758, 0x17d554a0, 0x97ee8758, 0x17d554a0)
    TEST_BLTZAL(0x7ba59500, 0x5ec946e0, 0x077f958c, 0x00000000, 0x00000000)
    TEST_BLTZAL(0xf952c748, 0x3de2fb80, 0xb3da8ec0, 0x3de2fb80, 0xb3da8ec0)
    TEST_BLTZAL(0xd77c3bd3, 0x7e35d110, 0xc636c3b0, 0x7e35d110, 0xc636c3b0)
    TEST_BLTZAL(0x26dda6d0, 0x237160b4, 0x4daf87f0, 0x00000000, 0x00000000)
    TEST_BLTZAL(0x502badc0, 0x2918933c, 0x370f69c0, 0x00000000, 0x00000000)
    TEST_BLTZAL(0xe6da4e94, 0xbff11c9d, 0x40ecfeb1, 0xbff11c9d, 0x40ecfeb1)
    TEST_BLTZAL(0x5c91b880, 0x7829cec0, 0xa2999300, 0x00000000, 0x00000000)
    TEST_BLTZAL(0x82ea2849, 0x7a767238, 0x4e9660c0, 0x7a767238, 0x4e9660c0)
    TEST_BLTZAL(0x94870718, 0x5de24514, 0x5d0421b6, 0x5de24514, 0x5d0421b6)
    TEST_BLTZAL(0xe224cb20, 0x18f1fa80, 0x150e5c3a, 0x18f1fa80, 0x150e5c3a)
    TEST_BLTZAL(0x3a14e59e, 0x4ea5a8bc, 0xb5ed7980, 0x00000000, 0x00000000)
    TEST_BLTZAL(0xdcbd66d6, 0x8673350c, 0xfb5f83b1, 0x8673350c, 0xfb5f83b1)
    TEST_BLTZAL(0x5c84b110, 0x960a74d8, 0xe239d950, 0x00000000, 0x00000000)
    TEST_BLTZAL(0xfc08307a, 0x25f6aa30, 0x43d5c894, 0x25f6aa30, 0x43d5c894)
    TEST_BLTZAL(0x30aee220, 0x8338ae38, 0xf28dd8d0, 0x00000000, 0x00000000)
    TEST_BLTZAL(0x85bd5b3a, 0xa4f7aacf, 0xa39c66c0, 0xa4f7aacf, 0xa39c66c0)
    TEST_BLTZAL(0xa171fee0, 0x3feda210, 0x77117a8c, 0x3feda210, 0x77117a8c)
    TEST_BLTZAL(0x79637610, 0xee52c578, 0x24890ec0, 0x00000000, 0x00000000)
    TEST_BLTZAL(0xbfea29c4, 0x846b8bea, 0x0727fb08, 0x846b8bea, 0x0727fb08)
    TEST_BLTZAL(0x6c103040, 0xb19f9e78, 0xd53b62e4, 0x00000000, 0x00000000)
    TEST_BLTZAL(0x4fa26e80, 0xc18b61f1, 0xb8d22ab0, 0x00000000, 0x00000000)
    TEST_BLTZAL(0x08e14a7e, 0xf327c65e, 0xd36cfac0, 0x00000000, 0x00000000)
    TEST_BLTZAL(0x95644160, 0x08d5b74a, 0xff5d10e4, 0x08d5b74a, 0xff5d10e4)
    TEST_BLTZAL(0xe11349c8, 0x38d51fd0, 0x47bcd2f0, 0x38d51fd0, 0x47bcd2f0)
    TEST_BLTZAL(0xab05d540, 0x170d0e20, 0x53a1d234, 0x170d0e20, 0x53a1d234)
    TEST_BLTZAL(0x00827dc8, 0x77030fa0, 0xe0766080, 0x00000000, 0x00000000)
    TEST_BLTZAL(0x4fb795e8, 0xff1f696e, 0xc65c117e, 0x00000000, 0x00000000)
    TEST_BLTZAL(0xe26c3dc8, 0x04c5ea92, 0xd4a9b540, 0x04c5ea92, 0xd4a9b540)
    TEST_BLTZAL(0x8ffd2b44, 0x656788a8, 0x9f96adc8, 0x656788a8, 0x9f96adc8)
    TEST_BLTZAL(0xe3481772, 0x9f2a10ee, 0xdd0e6718, 0x9f2a10ee, 0xdd0e6718)
    TEST_BLTZAL(0x7f7db200, 0xd1f8e093, 0x7db9f89c, 0x00000000, 0x00000000)
    TEST_BLTZAL(0x8e33fd2a, 0x114b1cf8, 0xf1369ae4, 0x114b1cf8, 0xf1369ae4)
    TEST_BLTZAL(0x083ba18a, 0xe036d934, 0x57d80e38, 0x00000000, 0x00000000)
    TEST_BLTZAL(0x138e07f8, 0xb3b0b3c9, 0x5a21b780, 0x00000000, 0x00000000)
    TEST_BLTZAL(0x244684db, 0x9b439a00, 0x9a8bf098, 0x00000000, 0x00000000)
    TEST_BLTZAL(0xa4f9cfdd, 0x364d45c0, 0x41bbe00c, 0x364d45c0, 0x41bbe00c)
    TEST_BLTZAL(0xa31a8b88, 0x80dffe44, 0x2bfa1dd8, 0x80dffe44, 0x2bfa1dd8)
    TEST_BLTZAL(0x028a5cdc, 0xca727700, 0xd1acb3d8, 0x00000000, 0x00000000)
    TEST_BLTZAL(0xf4158168, 0x5b36fb58, 0xdac1338c, 0x5b36fb58, 0xdac1338c)
    TEST_BLTZAL(0xaede9100, 0x9aefd3e0, 0xeb172cbe, 0x9aefd3e0, 0xeb172cbe)
    TEST_BLTZAL(0x7d933080, 0xa7436d60, 0x2f1814c4, 0x00000000, 0x00000000)
    TEST_BLTZAL(0x5b78e940, 0x8dcec176, 0xb8726e32, 0x00000000, 0x00000000)
    TEST_BLTZAL(0x2f5f8070, 0x58205fc0, 0xe57e23ad, 0x00000000, 0x00000000)
    TEST_BLTZAL(0xda7308f4, 0x9b86c9b8, 0x913775a0, 0x9b86c9b8, 0x913775a0)
    TEST_BLTZAL(0xe9c9da6a, 0xc2339e20, 0xa4268ba0, 0xc2339e20, 0xa4268ba0)
    TEST_BLTZAL(0xab39c2d2, 0xa3d5a878, 0x1727c53b, 0xa3d5a878, 0x1727c53b)
    TEST_BLTZAL(0xbe97cbea, 0xd1834712, 0x81b9b444, 0xd1834712, 0x81b9b444)
    TEST_BLTZAL(0xccbb6fe8, 0x58edca80, 0xe32f1c00, 0x58edca80, 0xe32f1c00)
    TEST_BLTZAL(0xca8292c0, 0x05b81cc8, 0x5dc2535b, 0x05b81cc8, 0x5dc2535b)
    TEST_BLTZAL(0x87216bb1, 0x5745c9ac, 0x559f39ac, 0x5745c9ac, 0x559f39ac)
    TEST_BLTZAL(0xc4660448, 0xbd2e3330, 0x48eeaa30, 0xbd2e3330, 0x48eeaa30)
    TEST_BLTZAL(0x443ff57c, 0x6c6efe6f, 0x878908f7, 0x00000000, 0x00000000)
    TEST_BLTZAL(0x7d6ee738, 0xe0611dfc, 0x9f031122, 0x00000000, 0x00000000)
    TEST_BLTZAL(0xd3d10d4d, 0x7d247ed0, 0xf5722c22, 0x7d247ed0, 0xf5722c22)
    TEST_BLTZAL(0x1f949120, 0x820b11fe, 0xdc05404a, 0x00000000, 0x00000000)
    TEST_BLTZAL(0xc68f0040, 0x77c6a186, 0x9f2c9ee6, 0x77c6a186, 0x9f2c9ee6)
    TEST_BLTZAL(0xc7312578, 0x3be03aec, 0xc0fee200, 0x3be03aec, 0xc0fee200)
    TEST_BLTZAL(0x309ac032, 0xaadf3100, 0x497ec7b0, 0x00000000, 0x00000000)
    TEST_BLTZAL(0x2092e460, 0xea8c1a16, 0x7fb0dc44, 0x00000000, 0x00000000)
    TEST_BLTZAL(0xf724628b, 0x24cd6a00, 0x06d5bbd0, 0x24cd6a00, 0x06d5bbd0)
    TEST_BLTZAL(0x33bf4222, 0xb8acf8f9, 0xdafc8a00, 0x00000000, 0x00000000)
    TEST_BLTZAL(0x9e234e33, 0x7172c748, 0x61ac8e1e, 0x7172c748, 0x61ac8e1e)
    TEST_BLTZAL(0xf9756dbc, 0x021822c8, 0xa5ed4b94, 0x021822c8, 0xa5ed4b94)
    TEST_BLTZAL(0x60880d60, 0xd8442aaf, 0xaac6de74, 0x00000000, 0x00000000)
    TEST_BLTZAL(0x33699318, 0xeb2f7fcc, 0xdcfbd7b6, 0x00000000, 0x00000000)
    TEST_BLTZAL(0x1beacb00, 0xe333f8e8, 0xd492d830, 0x00000000, 0x00000000)
    TEST_BLTZAL(0xf3abd08a, 0xc25e31c0, 0xf178fcc7, 0xc25e31c0, 0xf178fcc7)
    TEST_BLTZAL(0xbbb85c80, 0x747014c0, 0xa2f6fdf0, 0x747014c0, 0xa2f6fdf0)
    TEST_BLTZAL(0x3a43003a, 0xeeed819a, 0xb2fad2e0, 0x00000000, 0x00000000)
    TEST_BLTZAL(0x5037f2c4, 0xdc5b45a0, 0x2ec3ec30, 0x00000000, 0x00000000)
    TEST_BLTZAL(0xa8456f6e, 0xaff24380, 0x319e3974, 0xaff24380, 0x319e3974)
    TEST_BLTZAL(0x414853a0, 0x637439d2, 0x6693d9c0, 0x00000000, 0x00000000)
    TEST_BLTZAL(0xe7456b0a, 0x51b4161c, 0xfeaa18a0, 0x51b4161c, 0xfeaa18a0)
    TEST_BLTZAL(0xbb74e538, 0x6ed74130, 0x984f6072, 0x6ed74130, 0x984f6072)
    TEST_BLTZAL(0x22d313b0, 0xa42543e0, 0x4e7cf014, 0x00000000, 0x00000000)
    TEST_BLTZAL(0x5879a989, 0x80ef8300, 0x3576293c, 0x00000000, 0x00000000)
    TEST_BLTZAL(0x6dd7a283, 0x67f82b20, 0x3eeddf3c, 0x00000000, 0x00000000)
    TEST_BLTZAL(0x8c3e6232, 0x6b6cd290, 0x360783ea, 0x6b6cd290, 0x360783ea)
    TEST_BLTZAL(0x9935c478, 0xcaaa3fe0, 0xbfbf76f0, 0xcaaa3fe0, 0xbfbf76f0)
    TEST_BLTZAL(0xaa40e800, 0xd0658f18, 0x27947ea4, 0xd0658f18, 0x27947ea4)
    TEST_BLTZAL(0x95c54b0e, 0x2c0a79d8, 0xba269468, 0x2c0a79d8, 0xba269468)
    TEST_BLTZAL(0x0c643508, 0xb70c9fb0, 0xfc6798bc, 0x00000000, 0x00000000)
    TEST_BLTZAL(0x7c26fe64, 0x1bde5440, 0x0a02d616, 0x00000000, 0x00000000)
    TEST_BLTZAL(0xfd4d12cc, 0x375d3388, 0x931732c2, 0x375d3388, 0x931732c2)
    TEST_BLTZAL(0x3bb516cb, 0x9a02b930, 0xbca4f17c, 0x00000000, 0x00000000)
    TEST_BLTZAL(0x72a53c58, 0xdc2567e4, 0x70280859, 0x00000000, 0x00000000)
    TEST_BLTZAL(0x99119a2e, 0x184ac668, 0x2127b7d2, 0x184ac668, 0x2127b7d2)
    TEST_BLTZAL(0xb446190a, 0x7d1f992e, 0x3cde2960, 0x7d1f992e, 0x3cde2960)
    TEST_BLTZAL(0x1b8f96bc, 0xf3cdf593, 0x97e1fbbc, 0x00000000, 0x00000000)
    TEST_BLTZAL(0x789194bf, 0xdcdbab7f, 0x1e341cf8, 0x00000000, 0x00000000)
    TEST_BLTZAL(0x63c50b28, 0x061e6658, 0x322ff830, 0x00000000, 0x00000000)
    TEST_BLTZAL(0x3bc5a0e0, 0x563a0440, 0x0817b7a8, 0x00000000, 0x00000000)
    TEST_BLTZAL(0x92c167f8, 0xe27e6888, 0x4e28c838, 0xe27e6888, 0x4e28c838)
    TEST_BLTZAL(0x3ee483a8, 0x3e09bb40, 0x65b17d20, 0x00000000, 0x00000000)
    TEST_BLTZAL(0x4eaa5a80, 0x6edf66a4, 0x27264b04, 0x00000000, 0x00000000)
    TEST_BLTZAL(0xc25a94c0, 0x16648180, 0xceff49a0, 0x16648180, 0xceff49a0)
    TEST_BLTZAL(0x178e29a0, 0xa5b5a538, 0xc4440224, 0x00000000, 0x00000000)
    TEST_BLTZAL(0x1946faac, 0xaa83b7aa, 0xc9244bf5, 0x00000000, 0x00000000)
    TEST_BLTZAL(0x8a6e27ba, 0x5479233d, 0x0fe51340, 0x5479233d, 0x0fe51340)
    TEST_BLTZAL(0xc1a17acc, 0x4081010d, 0xff791604, 0x4081010d, 0xff791604)
    TEST_BLTZAL(0x45e5dec0, 0xd701b72c, 0x5888fdd8, 0x00000000, 0x00000000)
    TEST_BLTZAL(0x93326582, 0xf1f955c0, 0xcf5e55ca, 0xf1f955c0, 0xcf5e55ca)
    TEST_BLTZAL(0x00928868, 0x090455b2, 0xf5c1b600, 0x00000000, 0x00000000)
    TEST_BLTZAL(0xf7ccd1e8, 0x16332a88, 0x54968884, 0x16332a88, 0x54968884)
    TEST_BLTZAL(0x6ec43ef0, 0xfb8f16d5, 0x09b69d60, 0x00000000, 0x00000000)
    TEST_BLTZAL(0x16c9ba2e, 0x37daacd7, 0x7986d400, 0x00000000, 0x00000000)
    TEST_BLTZAL(0xbae401b8, 0xe096eec2, 0x15e2e1e0, 0xe096eec2, 0x15e2e1e0)
    TEST_BLTZAL(0x7a4a5eb6, 0x1fd9b7a8, 0x7f6b7a00, 0x00000000, 0x00000000)
    TEST_BLTZAL(0x50d83460, 0x5b458d34, 0xb3e5b6c0, 0x00000000, 0x00000000)
    TEST_BLTZAL(0x42e7c900, 0xe3efdfde, 0x0d3d9b80, 0x00000000, 0x00000000)
    TEST_BLTZAL(0xf8841282, 0x729968e0, 0x16e13cca, 0x729968e0, 0x16e13cca)
    TEST_BLTZAL(0xa98425f8, 0xbc443ce7, 0xae756fac, 0xbc443ce7, 0xae756fac)
    TEST_BLTZAL(0x6c1f0d47, 0x1afdcbfa, 0x9ccde33e, 0x00000000, 0x00000000)
    TEST_BLTZAL(0xfcf950ca, 0x8954be60, 0x82ec2818, 0x8954be60, 0x82ec2818)
    TEST_BLTZAL(0x74f524b2, 0xb1151634, 0xa1cb0328, 0x00000000, 0x00000000)
    TEST_BLTZAL(0xc9bca1a8, 0x2a1a3688, 0xea2bb980, 0x2a1a3688, 0xea2bb980)
    TEST_BLTZAL(0x4f8b1162, 0x560409a8, 0x5df83060, 0x00000000, 0x00000000)
    TEST_BLTZAL(0x00dba000, 0xff655f88, 0xe7eb1ef4, 0x00000000, 0x00000000)
    TEST_BLTZAL(0xa199561e, 0x92b64a0c, 0xe8669a08, 0x92b64a0c, 0xe8669a08)
    TEST_BLTZAL(0x73ee8202, 0xd7a56490, 0x79518f38, 0x00000000, 0x00000000)
    TEST_BLTZAL(0x00000000, 0xafbac4d4, 0xf06fb6ae, 0x00000000, 0x00000000)
###detect exception
    bne s2, zero, inst_error
    nop
###score ++
    addiu s3, s3, 1
###output (s0<<24)|s3
inst_error:  
    sll t1, s0, 24
    or t0, t1, s3 
    sw t0, 0(s1)
    jr ra
    nop
END(n41_bltzal_test)
